package com.gitee.wsl.ext.array

fun <T> Array<T>.fill(value: T) {
    for (n in indices) this[n] = value
}

fun IntArray.fill(value: Int) {
    for (n in indices) this[n] = value
}

@OptIn(ExperimentalUnsignedTypes::class)
fun UByteArray.overwriteWithZeroes() {
    for (i in 0 until size) {
        this[i] = 0U
    }
}

@OptIn(ExperimentalUnsignedTypes::class)
fun UIntArray.overwriteWithZeroes() {
    for (i in 0 until size) {
        this[i] = 0U
    }
}